package NC7_买卖股票的最好时机1;

import java.util.*;


public class Solution {
    /**
     *
     * @param prices int整型一维数组
     * @return int整型
     */
    public int maxProfit (int[] prices) {
        // write code here
        int max = 0;
        for (int i = 0; i < prices.length; i++){
            for (int j = i; j < prices.length; j++){
                max = Math.max(max, prices[j] - prices[i]);
            }
        }
        return max;
    }
}